<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Insert title here</title>
</head>
<body>

<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
<!-- 新 Bootstrap 核心 CSS 文件 -->
<link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/bootstrap/css/bootstrap-theme.min.css">
<link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/bootstrap/css/default.css">

<!-- Custom styles for this template -->
<link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/dashboard.css">
<link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/adminnav.css">
<link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/bootstrap/css/style.css">

<!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
<script src="${pageContext.request.contextPath}/static/js/jquery-1.11.3.js"></script>
<script src="${pageContext.request.contextPath}/static/js/functions.js"></script>

<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script src="${pageContext.request.contextPath}/static/css/bootstrap/js/bootstrap.min.js"></script>
<script src="${pageContext.request.contextPath}/static/css/bootstrap/js/prettify.min.js"></script>
<script src="${pageContext.request.contextPath}/static/css/bootstrap/js/multiselect.min.js"></script>

<script type="text/javascript">
    $(document).ready(
        function () {
            var currentPage = ${page.currentPage};
            var totalPage = ${page.totalPage};

            $("#pagination1").pagination({
                currentPage: currentPage,
                totalPage: totalPage,
                callback: function (current) {//current 当前页
                    var info = $("#pagination1").pagination("getPage");
                    location.href = "${pageContext.request.contextPath}/size/sizeList?currentPage=" + info.current;
                }
            });
        });
</script>

<c:import url="../common/adminTopNav.jsp"/>

<div class="container-fluid">
    <div class="row">
        <div class="col-sm-3 col-md-2 sidebar">
            <c:import url="../common/adminLeftNav.jsp"/>
        </div>
        <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">

            <h2 class="sub-header">商品尺码列表</h2>
            <a class="btn btn-primary" href="${pageContext.request.contextPath}/size/toAddOrUpdateSizePage">添加商品尺码</a>

            <div class="table-responsive">
                <table class="table table-striped">
                    <thead>
                    <tr>
                        <th>#</th>
                        <th>商品尺码名称</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <c:forEach items="${page.data}" var="size" varStatus="status">
                        <tr>
                            <td>${status.count}</td>
                            <td>${size.sizeName}</td>
                            <td>
                                <a href="${pageContext.request.contextPath}/size/toAddOrUpdateSizePage?sizeId=${size.sizeId}">修改</a>
                                |
                                <a href="${pageContext.request.contextPath}/size/deleteSize?sizeId=${size.sizeId}"
                                   onclick="return confirm('确定要删除这个尺码吗？')">删除</a>
                            </td>
                        </tr>
                    </c:forEach>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>

<!-- 分页 -->
<c:import url="../common/page_bottom.jsp"/>

<c:import url="../common/adminFooter.jsp"/>

</body>
</html>